/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Telas;

import Conexao.ConectaBD;
import java.awt.Toolkit;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import net.proteanit.sql.DbUtils;

/**
 *
 * @author Thalyson
 */
public class Tela_RegSolicitacao extends javax.swing.JFrame {

    Connection conecta;
    PreparedStatement pst;
    ResultSet rs;
    
    public Tela_RegSolicitacao() throws ClassNotFoundException {
        initComponents();
        setSize(805, 553);
        setLocationRelativeTo(null);
        conecta = ConectaBD.conectabd();
        listarSolicitacoes();
        selecionaFuncionario();
        Icon();
    }

//<----------------------------------------------------------------------------------------------------------------------------------------->    

    private void Icon(){
    
        setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("assistec_icon.png")));
        
    }    
    
//<----------------------------------------------------------------------------------------------------------------------------------------->    

    public void listarSolicitacoes() {
        String sql = "Select *from solicitacao order by Status Asc";
        try {
            pst = conecta.prepareStatement(sql);
            rs = pst.executeQuery();
            jt_solicitacao.setModel(DbUtils.resultSetToTableModel(rs));
        } catch (SQLException error) {
            JOptionPane.showMessageDialog(null, error);
        }
    }
    
//<----------------------------------------------------------------------------------------------------------------------------------------->    

    public void cadastrarSolicitacao() {
        String sql = "Insert into solicitacao (Funcionario,Tipo,Descriçao,Status) values(?,?,?,?)";
        
        if(cb_funcionario.getSelectedItem().equals("NOME DO FUNCIONÁRIO")){
        JOptionPane.showMessageDialog(null, "Campo Nome do Funcionário é Obrigatório", "Aviso", JOptionPane.WARNING_MESSAGE);
        return;
        }
        if(cb_tipo.getSelectedItem().equals("TIPO DE SOLICITAÇÃO")){
        JOptionPane.showMessageDialog(null, "Campo Tipo de Solicitação é Obrigatório", "Aviso", JOptionPane.WARNING_MESSAGE);
        return;
        }
        if(jt_descricao.getText().equals("")){
        JOptionPane.showMessageDialog(null, "Campo Descrição é Obrigatório", "Aviso", JOptionPane.WARNING_MESSAGE);
        return;
        }
        if(cb_status.getSelectedItem().equals("STATUS")){
        JOptionPane.showMessageDialog(null, "Campo Status é Obrigatório", "Aviso", JOptionPane.WARNING_MESSAGE);
        return;
        }
        if(cb_status.getSelectedItem().equals("RESOLVIDO")){
        JOptionPane.showMessageDialog(null, "Campo Status é Obrigatório", "Aviso", JOptionPane.WARNING_MESSAGE);
        return;
        }
        if(cb_status.getSelectedItem().equals("NÃO RESOLVIDO")){
        JOptionPane.showMessageDialog(null, "Campo Status é Obrigatório", "Aviso", JOptionPane.WARNING_MESSAGE);
        return;
        }
        
        try {
            pst = conecta.prepareStatement(sql);
            pst.setString(1, cb_funcionario.getSelectedItem().toString());
            pst.setString(2, cb_tipo.getSelectedItem().toString());
            pst.setString(3, jt_descricao.getText());
            pst.setString(4, cb_status.getSelectedItem().toString());
            
            pst.execute();
            JOptionPane.showMessageDialog(null, "Registrada com Sucesso!", "Registrada com Sucesso", JOptionPane.INFORMATION_MESSAGE);
            listarSolicitacoes();
            Limpar();

        } catch (SQLException error) {
            JOptionPane.showMessageDialog(null, error);
        }
    }
    
//<----------------------------------------------------------------------------------------------------------------------------------------->    

    public void pesquisarSolicitacoes() {
        String sql = "Select *from solicitacao where Funcionario like ?";

        try {
            pst = conecta.prepareStatement(sql);
            pst.setString(1, tf_pesquisar.getText() + "%");
            rs = pst.executeQuery();
            jt_solicitacao.setModel(DbUtils.resultSetToTableModel(rs));
        } catch (SQLException error) {
            JOptionPane.showMessageDialog(null, error);
        }
    }
    
//<----------------------------------------------------------------------------------------------------------------------------------------->    

    public void mostraItens() {
        int seleciona = jt_solicitacao.getSelectedRow();
        tf_id.setText(jt_solicitacao.getModel().getValueAt(seleciona, 0).toString());
        cb_funcionario.setSelectedItem(jt_solicitacao.getModel().getValueAt(seleciona, 1).toString());
        cb_tipo.setSelectedItem(jt_solicitacao.getModel().getValueAt(seleciona, 2).toString());
        jt_descricao.setText(jt_solicitacao.getModel().getValueAt(seleciona, 3).toString());
        cb_status.setSelectedItem(jt_solicitacao.getModel().getValueAt(seleciona, 4).toString());
    }
    
//<----------------------------------------------------------------------------------------------------------------------------------------->    

    public void editarSolicitacoes() {
        String sql = "Update solicitacao set Funcionario = ?,Tipo = ?,Descriçao = ?,Status = ? where id = ? ";
        
        if(cb_status.getSelectedItem().equals("RESOLVIDO")){
        JOptionPane.showMessageDialog(null, "Campo Status é Obrigatório", "Aviso", JOptionPane.WARNING_MESSAGE);
        return;
        }
        if(cb_status.getSelectedItem().equals("NÃO RESOLVIDO")){
        JOptionPane.showMessageDialog(null, "Campo Status é Obrigatório", "Aviso", JOptionPane.WARNING_MESSAGE);
        return;
        }
        
        try {
            pst = conecta.prepareStatement(sql);
            pst.setString(1, cb_funcionario.getSelectedItem().toString());
            pst.setString(2, cb_tipo.getSelectedItem().toString());
            pst.setString(3, jt_descricao.getText());
            pst.setString(4, cb_status.getSelectedItem().toString());
            pst.setInt(5, Integer.parseInt(tf_id.getText()));
            pst.executeUpdate();
            JOptionPane.showMessageDialog(null, "Solicitação atualizada com sucesso");
            listarSolicitacoes();

        } catch (SQLException error) {
            JOptionPane.showMessageDialog(null, error);
        }
    }
    
//<----------------------------------------------------------------------------------------------------------------------------------------->    
    private void selecionaFuncionario() {

        try {
                
            String sql = "select * from funcionario";
            pst = conecta.prepareStatement(sql);
            rs = pst.executeQuery();                
            while (rs.next()) {
                String Funcionario = rs.getString("Nome");
                cb_funcionario.addItem(Funcionario);               
            }

        } catch (Exception e) {
        }

    }    
    
//<----------------------------------------------------------------------------------------------------------------------------------------->    

            public void Novo(){
            
                try {
                    
                cb_funcionario.setEnabled(true);
                cb_tipo.setEnabled(true);               
                jt_descricao.setEditable(true);
                cb_status.setEnabled(true);
                jb_salvar.setEnabled(true);
                
                Limpar();
                    
                } catch (Exception e) {
                }
                
            }
            
//<----------------------------------------------------------------------------------------------------------------------------------------->    

                public void Limpar(){
                                                            
                    cb_funcionario.setSelectedItem("NOME DO FUNCIONÁRIO");
                    cb_tipo.setSelectedItem("TIPO DE SOLICITAÇÃO");
                    jt_descricao.setText("");
                    cb_status.setSelectedItem("STATUS");
                
                }
    
    
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        cb_funcionario = new javax.swing.JComboBox();
        jLabel4 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jt_descricao = new javax.swing.JTextArea();
        cb_status = new javax.swing.JComboBox();
        jLabel20 = new javax.swing.JLabel();
        cb_tipo = new javax.swing.JComboBox();
        jLabel3 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        tf_id = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        tf_pesquisar = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_solicitacao = new javax.swing.JTable();
        jLabel23 = new javax.swing.JLabel();
        jb_novo = new javax.swing.JButton();
        jb_atualizar = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel13 = new javax.swing.JLabel();
        jb_salvar = new javax.swing.JButton();
        jb_limpar = new javax.swing.JButton();
        jb_fechar = new javax.swing.JButton();
        jb_editar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("AssisTec - Registrar Solicitação");
        setResizable(false);
        getContentPane().setLayout(null);

        cb_funcionario.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
        cb_funcionario.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "NOME DO FUNCIONÁRIO" }));
        cb_funcionario.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        cb_funcionario.setEnabled(false);
        getContentPane().add(cb_funcionario);
        cb_funcionario.setBounds(10, 30, 340, 30);

        jLabel4.setBackground(new java.awt.Color(255, 255, 255));
        jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("NOME DO FUNCIONÁRIO");
        getContentPane().add(jLabel4);
        jLabel4.setBounds(10, 10, 170, 14);

        jLabel18.setBackground(new java.awt.Color(255, 255, 255));
        jLabel18.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel18.setForeground(new java.awt.Color(255, 255, 255));
        jLabel18.setText("DESCRIÇÃO DA SOLICITAÇÃO");
        getContentPane().add(jLabel18);
        jLabel18.setBounds(10, 70, 210, 14);

        jScrollPane6.setBackground(new java.awt.Color(255, 255, 255));
        jScrollPane6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));

        jt_descricao.setEditable(false);
        jt_descricao.setColumns(20);
        jt_descricao.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
        jt_descricao.setRows(5);
        jt_descricao.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        jt_descricao.setSelectionColor(new java.awt.Color(0, 0, 0));
        jScrollPane6.setViewportView(jt_descricao);

        getContentPane().add(jScrollPane6);
        jScrollPane6.setBounds(10, 90, 400, 150);

        cb_status.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
        cb_status.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "STATUS", "EM ESPERA", "RESOLVIDO", "NÃO RESOLVIDO" }));
        cb_status.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        cb_status.setEnabled(false);
        getContentPane().add(cb_status);
        cb_status.setBounds(420, 90, 150, 30);

        jLabel20.setBackground(new java.awt.Color(255, 255, 255));
        jLabel20.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel20.setForeground(new java.awt.Color(255, 255, 255));
        jLabel20.setText("STATUS");
        getContentPane().add(jLabel20);
        jLabel20.setBounds(420, 70, 60, 14);

        cb_tipo.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
        cb_tipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "TIPO DE SOLICITAÇÃO", "REMOVER", "EDITAR/ALTERAR", "ADICIONAR", "OUTRO" }));
        cb_tipo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        cb_tipo.setEnabled(false);
        getContentPane().add(cb_tipo);
        cb_tipo.setBounds(360, 30, 270, 30);

        jLabel3.setBackground(new java.awt.Color(255, 255, 255));
        jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("TIPO DE SOLICITAÇÃO");
        getContentPane().add(jLabel3);
        jLabel3.setBounds(360, 10, 140, 14);

        jLabel14.setBackground(new java.awt.Color(255, 255, 255));
        jLabel14.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel14.setForeground(new java.awt.Color(255, 255, 255));
        jLabel14.setText("ID");
        getContentPane().add(jLabel14);
        jLabel14.setBounds(580, 110, 30, 20);

        tf_id.setEditable(false);
        tf_id.setBackground(new java.awt.Color(255, 255, 255));
        tf_id.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
        tf_id.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        tf_id.setSelectionColor(new java.awt.Color(0, 0, 0));
        getContentPane().add(tf_id);
        tf_id.setBounds(580, 130, 50, 30);

        jLabel15.setBackground(new java.awt.Color(255, 255, 255));
        jLabel15.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel15.setForeground(new java.awt.Color(255, 255, 255));
        jLabel15.setText("PESQUISAR FUNCIONÁRIO");
        getContentPane().add(jLabel15);
        jLabel15.setBounds(530, 190, 180, 14);

        jLabel16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_lupa.png"))); // NOI18N
        getContentPane().add(jLabel16);
        jLabel16.setBounds(510, 210, 20, 30);

        tf_pesquisar.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N
        tf_pesquisar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        tf_pesquisar.setSelectionColor(new java.awt.Color(0, 0, 0));
        tf_pesquisar.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                tf_pesquisarKeyReleased(evt);
            }
        });
        getContentPane().add(tf_pesquisar);
        tf_pesquisar.setBounds(530, 210, 260, 30);

        jLabel10.setBackground(new java.awt.Color(255, 255, 255));
        jLabel10.setFont(new java.awt.Font("Times New Roman", 1, 12)); // NOI18N
        jLabel10.setForeground(new java.awt.Color(255, 255, 255));
        jLabel10.setText("REGISTRAR SOLICITAÇÃO");
        getContentPane().add(jLabel10);
        jLabel10.setBounds(640, 170, 160, 14);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_solicitação.png"))); // NOI18N
        getContentPane().add(jLabel2);
        jLabel2.setBounds(640, 10, 150, 150);

        jt_solicitacao.setAutoCreateRowSorter(true);
        jt_solicitacao.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        jt_solicitacao.setSelectionBackground(new java.awt.Color(0, 0, 0));
        jt_solicitacao.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_solicitacaoMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(jt_solicitacao);

        getContentPane().add(jScrollPane1);
        jScrollPane1.setBounds(0, 250, 800, 190);

        jLabel23.setBackground(new java.awt.Color(255, 255, 255));
        jLabel23.setForeground(new java.awt.Color(255, 255, 255));
        jLabel23.setText("TABELA DE SOLICITAÇÕES");
        getContentPane().add(jLabel23);
        jLabel23.setBounds(330, 440, 220, 20);

        jb_novo.setBackground(new java.awt.Color(255, 255, 255));
        jb_novo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_novo.png"))); // NOI18N
        jb_novo.setText("NOVO");
        jb_novo.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        jb_novo.setBorderPainted(false);
        jb_novo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_novoActionPerformed(evt);
            }
        });
        getContentPane().add(jb_novo);
        jb_novo.setBounds(10, 470, 100, 50);

        jb_atualizar.setBackground(new java.awt.Color(255, 255, 255));
        jb_atualizar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_atualizar.png"))); // NOI18N
        jb_atualizar.setText("ATUALIZAR");
        jb_atualizar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 255, 255)));
        jb_atualizar.setBorderPainted(false);
        jb_atualizar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_atualizarActionPerformed(evt);
            }
        });
        getContentPane().add(jb_atualizar);
        jb_atualizar.setBounds(110, 470, 100, 50);

        jSeparator2.setForeground(new java.awt.Color(255, 255, 255));
        getContentPane().add(jSeparator2);
        jSeparator2.setBounds(70, 460, 730, 10);

        jLabel13.setBackground(new java.awt.Color(255, 255, 255));
        jLabel13.setForeground(new java.awt.Color(255, 255, 255));
        jLabel13.setText("AssisTec");
        getContentPane().add(jLabel13);
        jLabel13.setBounds(10, 450, 60, 14);

        jb_salvar.setBackground(new java.awt.Color(255, 255, 255));
        jb_salvar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_salvar.png"))); // NOI18N
        jb_salvar.setText("SALVAR");
        jb_salvar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(78, 78, 78)));
        jb_salvar.setBorderPainted(false);
        jb_salvar.setEnabled(false);
        jb_salvar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_salvarActionPerformed(evt);
            }
        });
        getContentPane().add(jb_salvar);
        jb_salvar.setBounds(390, 470, 100, 50);

        jb_limpar.setBackground(new java.awt.Color(255, 255, 255));
        jb_limpar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_limpar.png"))); // NOI18N
        jb_limpar.setText("LIMPAR");
        jb_limpar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(78, 78, 78)));
        jb_limpar.setBorderPainted(false);
        jb_limpar.setEnabled(false);
        jb_limpar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_limparActionPerformed(evt);
            }
        });
        getContentPane().add(jb_limpar);
        jb_limpar.setBounds(590, 470, 100, 50);

        jb_fechar.setBackground(new java.awt.Color(255, 255, 255));
        jb_fechar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_fechar.png"))); // NOI18N
        jb_fechar.setText("FECHAR");
        jb_fechar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(78, 78, 78)));
        jb_fechar.setBorderPainted(false);
        jb_fechar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_fecharActionPerformed(evt);
            }
        });
        getContentPane().add(jb_fechar);
        jb_fechar.setBounds(690, 470, 100, 50);

        jb_editar.setBackground(new java.awt.Color(255, 255, 255));
        jb_editar.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_editar.png"))); // NOI18N
        jb_editar.setText("EDITAR");
        jb_editar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(78, 78, 78)));
        jb_editar.setBorderPainted(false);
        jb_editar.setEnabled(false);
        jb_editar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jb_editarActionPerformed(evt);
            }
        });
        getContentPane().add(jb_editar);
        jb_editar.setBounds(490, 470, 100, 50);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Imagens/assistec_fundo.png"))); // NOI18N
        getContentPane().add(jLabel1);
        jLabel1.setBounds(0, 0, 800, 550);

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void tf_pesquisarKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_tf_pesquisarKeyReleased
        pesquisarSolicitacoes();
    }//GEN-LAST:event_tf_pesquisarKeyReleased

    private void jt_solicitacaoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jt_solicitacaoMouseClicked
        mostraItens();
        jb_editar.setEnabled(true);
        jb_limpar.setEnabled(true);
        jb_salvar.setEnabled(false);

        cb_funcionario.setEnabled(true);
        cb_tipo.setEnabled(true);
        jt_descricao.setEditable(true);
        cb_status.setEnabled(false);
        jb_salvar.setEnabled(false);
    }//GEN-LAST:event_jt_solicitacaoMouseClicked

    private void jb_novoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_novoActionPerformed
        Novo();
        jb_editar.setEnabled(false);
        jb_limpar.setEnabled(true);
    }//GEN-LAST:event_jb_novoActionPerformed

    private void jb_atualizarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_atualizarActionPerformed
        listarSolicitacoes();
        jb_editar.setEnabled(false);
    }//GEN-LAST:event_jb_atualizarActionPerformed

    private void jb_salvarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_salvarActionPerformed
        cadastrarSolicitacao();
    }//GEN-LAST:event_jb_salvarActionPerformed

    private void jb_limparActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_limparActionPerformed
        Limpar();
    }//GEN-LAST:event_jb_limparActionPerformed

    private void jb_fecharActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_fecharActionPerformed
        dispose();
    }//GEN-LAST:event_jb_fecharActionPerformed

    private void jb_editarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jb_editarActionPerformed
        editarSolicitacoes();
    }//GEN-LAST:event_jb_editarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Tela_RegSolicitacao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Tela_RegSolicitacao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Tela_RegSolicitacao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Tela_RegSolicitacao.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                try {
                    new Tela_RegSolicitacao().setVisible(true);
                } catch (ClassNotFoundException ex) {
                    Logger.getLogger(Tela_RegSolicitacao.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox cb_funcionario;
    private javax.swing.JComboBox cb_status;
    private javax.swing.JComboBox cb_tipo;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JButton jb_atualizar;
    private javax.swing.JButton jb_editar;
    private javax.swing.JButton jb_fechar;
    private javax.swing.JButton jb_limpar;
    private javax.swing.JButton jb_novo;
    private javax.swing.JButton jb_salvar;
    private javax.swing.JTextArea jt_descricao;
    private javax.swing.JTable jt_solicitacao;
    private javax.swing.JTextField tf_id;
    private javax.swing.JTextField tf_pesquisar;
    // End of variables declaration//GEN-END:variables
}
